#include <stdio.h>

int main(int argc, char *argv[]) {

    int n = 0, a = 0, l = 0, sum = 0;
    scanf("%d", &n);
    while (n--)
    {
        scanf("%d", &l);
        for (size_t i = 0; i < l; i++)
        {
            scanf("%d", &a);
            sum += a;
        }
        printf("%d\n", sum);
        sum = 0;
    }
    
    

    return 0;
}